from django.contrib import admin
from .models import Category, Tag, Article, Section, Translation


class SectionInline(admin.StackedInline):
    model = Section
    extra = 3

class ArticleAdmin(admin.ModelAdmin):
    list_display = ('title', 'status', 'category')
    list_filter = ['status', 'category']
    inlines = [SectionInline]


class TranslationInline(admin.StackedInline):
    model = Translation
    extra = 1

class SectionAdmin(admin.ModelAdmin):
    inlines = [TranslationInline]


admin.site.register(Category)
admin.site.register(Tag)
admin.site.register(Article, ArticleAdmin)
admin.site.register(Section, SectionAdmin)
